package com.whutosa.template.server.model;

import javax.persistence.*;

/**
 * Created by 19110 on 2016/9/22.
 */
@Entity
public class User {
    @Id
    @Column(columnDefinition = "varchar(20)")
    private String uid;
    private String pswd;
    private String name;

    public User() {
    }

    public User(String uid) {
        this.uid = uid;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPswd() {
        return pswd;
    }

    public void setPswd(String pswd) {
        this.pswd = pswd;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        User user = (User) o;

        return uid.equals(user.uid);

    }

    @Override
    public int hashCode() {
        return uid.hashCode();
    }
}
